-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create shim to run deno bids-validator #1942
base: master
Are you sure you want to change the base?
Conversation
This way anyone interested to use it could just git clone --depth 1 -b deno-build http://github.com/bids-standard/bids-validator export PATH="$PWD/bids-validator:$PATH" and start using it and know which version it is: ❯ bids-validator -V v1.14.6-dev.0-9-gdc61d0f3.deno An alternative for shim would be just to create it in that branch and then remove in CI only the .js files. I would be happy to redo if feels more sensible.
This is fine with me. In general, it would be good to get the version into the builds. Running from deno.land also shows "alpha". |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1942 +/- ##
==========================================
+ Coverage 85.68% 86.86% +1.18%
==========================================
Files 91 132 +41
Lines 3792 6351 +2559
Branches 1220 1524 +304
==========================================
+ Hits 3249 5517 +2268
- Misses 457 743 +286
- Partials 86 91 +5 ☔ View full report in Codecov by Sentry. |
yes - this is a poor man solution. Should remain working even when alpha would be replaced with a correct one! note that I added |
I think this should be superseded by #1985. LMK what you think. |
for version -- most likely. But there is no shim there, right? in any case -- feel welcome to replace with any proper solution you see fit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the versioning bits.
Still not sure why the shim is necessary. This: git clone --depth 1 -b deno-build https://github.com/bids-standard/bids-validator
export PATH="$PWD/bids-validator:$PATH"
bids-validator doesn't seem significantly less work than: deno run -A https://github.com/bids-standard/bids-validator/raw/deno-build/bids-validator.js or: deno run -A https://github.com/bids-standard/bids-validator/raw/master/bids-validator/src/bids-validator.js |
Because then you need to know dark inner magic how to run it! And if you need to know that for each and every tool -- life becomes exponentially hard(er). |
Co-authored-by: Chris Markiewicz <[email protected]>
I believe ❯ deno install -g -A https://raw.githubusercontent.com/bids-standard/bids-validator/master/bids-validator/src/bids-validator.ts
✅ Successfully installed bids-validator
/home/chris/.deno/bin/bids-validator
❯ cat .deno/bin/bids-validator
#!/bin/sh
# generated by deno install
exec deno run --allow-all --no-config 'https://raw.githubusercontent.com/bids-standard/bids-validator/master/bids-validator/src/bids-validator.ts' "$@" Or you can compile into a self-contained executable: $ deno compile -A https://raw.githubusercontent.com/bids-standard/bids-validator/master/bids-validator/src/bids-validator.ts -o ~/.local/bin/bids-validator |
so
❯ deno compile -A https://raw.githubusercontent.com/bids-standard/bids-validator/master/bids-validator/src/bids-validator.ts -o /tmp/bids-validator-deno
Compile https://raw.githubusercontent.com/bids-standard/bids-validator/master/bids-validator/src/bids-validator.ts to bids-validator
Archive: /home/yoh/.tmp/.tmpmsROj6/denort.zip
inflating: denort
❯ cat /tmp/bids-validator-deno
cat: /tmp/bids-validator-deno: No such file or directory
❯ ls -ld /tmp/bids-validator-deno*
ls: cannot access '/tmp/bids-validator-deno*': No such file or directory
❯ deno --version
deno 1.42.4 (release, x86_64-unknown-linux-gnu)
v8 12.3.219.9
typescript 5.4.3 overall -- if there is a standard way to "install", I am all for it I guess for installations. shim is also handy for using it during development while overloading some other (older) |
If git clone --depth 1 -b deno-build http://github.com/bids-standard/bids-validator
deno install -g -A bids-validator/bids-validator.js If you want to install from deno.land (latest tag): deno install -g -A https://deno.land/x/bids_validator If you want to install from GitHub: deno install -g -A https://github.com/bids-standard/bids-validator/raw/$REF/bids-validator/src/bids-validator.ts Deno caches things locally, so you shouldn't hit the internet after the first run unless you clear the cache.
The deno compile -o /tmp/bids-validator-deno -A https://raw.githubusercontent.com/bids-standard/bids-validator/master/bids-validator/src/bids-validator.ts |
wow -- it even compiles a full fledged executable! ❯ ldd /tmp/bids-validator-deno
linux-vdso.so.1 (0x00007fff7c334000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f49bdf8a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f49bdf5d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f49bdf58000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f49bde76000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f49bdc91000)
/lib64/ld-linux-x86-64.so.2 (0x00007f49c2c97000)
❯ file /tmp/bids-validator-deno
/tmp/bids-validator-deno: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[xxHash]=1306fac976605c34, stripped
❯ ls -ld /tmp/bids-validator-deno
-rwxrwxrwx 1 yoh yoh 82058405 Jun 11 09:45 /tmp/bids-validator-deno* that's crazy! All great info -- worth adding to some README.md somewhere, and may be in particular in that I will leave it up to you -- I would still have preferred to have a helper shim so I do not need to wonder what to do. But RTFM approach would also suffice -- at least it would make it easy for people to do what they want to do. |
with that binary build, I even wonder where/how could we stick it within |
oh, that was just a naive dream -- that executable is not self contained etc (obviously needs bundle of schema etc anyways) and also depends on hardcoded paths... bids@rolando:~$ ./bids-validator-deno --version
fatal: cannot change to '/tmp/bids-validator/bids-validator/src': No such file or directory
bids-validator file:///tmp/bids-validator/bids-validator/src/bids-validator.ts but it works if I provide a clone there. |
This way anyone interested to use it could just
and start using it and know which version it is:
An alternative for shim would be just to create it in that branch and then remove in CI only the .js files. I would be happy to redo if feels more sensible.